<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jQuery 发送 JSONP 请求</title>
    <script crossorigin="anonymous" src='https://cdn.bootcss.com/jquery/3.5.0/jquery.min.js'></script>
    <style>
        #text{
            width: 400px;
            height: 300px;
            border:solid 1px #666;
        }
    </style>
</head>
<body>
    <button>发送 jsonp 请求</button>
    <div id="text"></div>
    <script>
        $('button').eq(0).click(function(){
            //发送 JSONP 请求                               问号会最终转为函数名
            $.getJSON('http://127.0.0.1/jsonp-server?callback=?', function(data){
                // console.log(data);
                $('#text').html(data);
            });
        });
    </script>
</body>
</html>